#include "comm.hpp"

int main()
{
  key_t key = GetKey();
  int shmid = CreateShm();
  cout << "shmid: " << shmid << endl;
  char *shmaddr = (char *)shmat(shmid, nullptr, 0);

  // 向共享内存写入
  while (1)
  {
    sleep(1);
    cout << "Please Enter@ ";
    fgets(shmaddr, sharemem_size, stdin);
  }
  shmdt(shmaddr);
  shmctl(shmid, IPC_RMID, nullptr);

}
